<?php

$ingin = array('P' => 'Memberi tumpangan', 'U' => 'Menumpang');
$socmed = array('1' => 'Facebook', '2' => 'Twitter');


function generate_input_z($type='', $array=array(), $name='', $sel='') {
    if ($type == 'radio') {
        foreach ($array as $key => $val) {
            echo '<label class="radio">';
            echo '<input data-toggle="radio" type="' . $type . '" name="' . $name . '" value="' . $key . '"/>' . $val . '&nbsp;';
            echo '</label>';
        }
    } else {
        foreach ($array as $key => $val) {
            echo '<input type="' . $type . '" name="' . $key . '" value="' . $key . '"/>' . $val . '&nbsp;';
        }
    }
}
?>
<div class="page">
    <div class="container">
        <div class="span10 offset1" style="margin-top:20px" id="wrap">
<h4>EDIT PERJALANAN</h4>
<form name="go" method="POST" action="<?php echo site_url(); ?>/perjalanan/update/<?php echo $output['currentTrip'][0]['id'];?>">  
    <div class="row">          
    <div class="span2"> Kamu ingin:  </div>
    <div class="span4">        
        <?php generate_input_z('radio',$ingin,'status'); ?>
    </div>
    </div>
    <div class="row">
    <div class="span2">Dari</div>
    <div class="span4"><input class="span3" type="text" name="source_label" value="<?php echo $output['currentTrip'][0]['source_label']; ?>" /></div>
    </div>
    <div class="row">
    <div class="span2">Ke</div>    
    <div class="span4"><input class="span3" type="text" name="destination_label" value="<?php echo $output['currentTrip'][0]['destination_label']; ?>" /></div>
    </div>
    <div class="row">
    <div class="span2">Via </div>   
    <div class="span4"><input class="span3" type="text" name="via" value="<?php echo $output['currentTrip'][0]['via']; ?>" /></div>
    </div>
    <div class="row">
    <div class="span2">Jam</div>   
    <div class="span4"><input class="span3" type="text" name="departTime" type="datetime" value="<?php echo $output['currentTrip'][0]['departTime']; ?>" /></div>
    </div>
    <div class="row">
    <div class="span2">Harga </div>   
    <div class="span4"><input class="span3" type="text" name="priceInRupiah" value="<?php echo $output['currentTrip'][0]['priceInRupiah']; ?>" /></div>
    </div>
    <div class="row">
    <div class="span2">Catatan </div>   
    <div class="span3"><textarea rows="3" class="span1" name="notes" placeholder="masukkan catatan"><?php echo $output['currentTrip'][0]['notes']; ?></textarea></div>
    </div>
    <div class="row">
    <div class="span6">
    <input type="submit" class="btn btn-primary btn-large span2 offset6" value="POST"/>
</div></div>
</form>
    <br/>
</div>
</div>
</div>